package org.datacoder.geocoding.datastructures.geoshapes

import com.vividsolutions.jts.geom.*
import com.vividsolutions.jts.geom.impl.*
import org.datacoder.geocoding.*

/**
 * The lower left corner of the bounding rectangle
 * for a jurisdiction.
 */
class GeoPoint extends GeoShape {

    double lon
    double lat

    public retrieveValue(int type){
        if(type == LON){
            return lon
        }else{
            return lat
        }
    }

    public Geometry toGeometry(){
        Coordinate[] pointCoordinate = new Coordinate[1]
        pointCoordinate[0] = new Coordinate(lon, lat)
        Point point = new Point(
            new CoordinateArraySequence(pointCoordinate),
            GeocodingUtils.geometryFactory
        )
        return point
    }

}

